package com.dpp.controller.user;

import com.dpp.context.BaseContext;
import com.dpp.entity.Invite;
import com.dpp.result.Result;
import com.dpp.service.InviteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/user/invite")
public class InviteController {
    @Autowired
    private InviteService inviteService;
    @GetMapping("/code")
    public Result getCode(){
        String openid = BaseContext.getCurrentId();
        Invite invite= inviteService.getCode(openid);
        return Result.success(invite);
    }
    //@GetMapping("/write")
    //public Result write(String pass){
    //    String openid = BaseContext.getCurrentId();
    //    return  inviteService.CheckCode(pass,openid);
    //}
}
